const options = {
      moduleCache: {
        vue: Vue
      },
      async getFile(url) {
        const res = await fetch(url);
        if ( !res.ok )
          throw Object.assign(new Error(res.statusText + ' ' + url), { res });
        return {
          getContentData: asBinary => asBinary ? res.arrayBuffer() : res.text(),
        }
      },
      addStyle(textContent) {
        const style = Object.assign(document.createElement('style'), { textContent });
        const ref = document.head.getElementsByTagName('style')[0] || null;
        document.head.insertBefore(style, ref);
      },
}
const { loadModule } = window['vue3-sfc-loader'];
function loadVue(url,callback){
    if(callback){
        loadModule(url,options).then((module)=>{
            callback(module);
        }).catch(e=>{
            console.log(e)
        })
    }else{
        const com = Vue.defineAsyncComponent(() =>loadModule(url,options))
        return com;
    }

}